import { defineStore } from 'pinia'

export const userInfo = defineStore('userInfo', {
  state: () => {
    return {
      nickName: '用户昵称'
    }
  },
  actions: {
    setName(name) {
      this.nickName = name
    }
  },
  persist: {
    enabled: true,
    strategies: [
      {
        storage: localStorage,paths:['nickName']
      }
    ]
  }
})